package com.sentinel.demo01.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test01")
@Slf4j
public class Test01Controller {
  
  @GetMapping("/getInfo/{id}")
  public String getInfo(@PathVariable("id") Integer id) {
    // 从这里 判断有效参数
    if (Integer.compare(id, 0) == -1) {
      throw new IllegalArgumentException("参数异常");
    }
    log.info("处理业务信息");
    return "测试注解方式限流正常";
  }
}
